-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python / Jython 2.2 support for v0.5.0 #103
base: master
Are you sure you want to change the base?
Conversation
…some already had the call). Required if not using Nose (e.g. older versions of Python). NOTE need to manually call 11 test scripts.
Also see issue #98 for comments regarding |
It occurs to me that we can get around the absence of simplejson (at least for the spec tests) by storing or generating a version of the spec tests in native Python code (e.g. by using Python's |
Its funny you mentioned repr(), I have this in a few of my projects where I deal with self generated json (i.e. it isn't coming from an untrusted user):
I've not tried this with pystache yet though. Backported datetime/decimal work fine though. I found an old article that talks about Nose py2.2 support so I'll try that out when I get chance but manually running the tests has worked out so far. |
With regard to unit tests, my current thinking is to move away from requiring nose. This is primarily because Distribute's
Using Distribute's To support Python 2.2, it probably wouldn't be too hard to write a modified test collector that works with Python 2.2 and grabs all unit tests and doctests. That would let us unit test in Python 2.2 more easily going forward and without all the manual updates. By the way, I'd like eventually to be able to run the tests across all versions of Python with a single command. I've made issue #107 for this. It would be too much work to support all versions of Python without this capability. |
I just spent a few hours attempting to backport Nose to Py 2.2 see https://github.com/clach04/nose/tree/python_2.2_support it seems to work for CPython 2.2 but not Jython (2.2). I'm not likely to pursue Nose further. Basically Nose support under Jython 2.2 is a no go, I'm not sure if test (module) discovery is an option under Jython 2.2 :-( The nice thing about the way you've setup the test suite is that it uses unittest and then any test discovery mechanisms work if available, with manual invocation as a backup option (the changes to the unittests in this pull request make sure vanilla unittest work). Tox looks interesting. |
Thanks for putting effort into seeing if nose would work. I wouldn't have had a problem with using nose for older versions and Distribute's Test discovery and collection isn't impossible to implement on our own. Pretty much all you need is In the meantime, a poor man's option (which we'd have to maintain by hand) would be to have a single test module, say, with a line that looks like |
For future reference, here is the simpler, original form of the manual test-collection code I referenced above (just ~100 lines). Also for future reference, |
FYI, I got tox working in the development branch and pushed it. Tests pass for Python 2.4 to 3.2 with one command. Tox's documentation says they support Jython by default. |
I'm more convinced not to use nose after seeing all the open issues they have. I just ran into this one myself. |
FYI, I changed the test harness in the development branch so that nose is no longer needed or used. Running tox now tests Python 2.4 through 3.2. Instructions are in the README. I wonder if this will get you any farther in including 2.2 into the test harness. |
Jython has come on a long way since 2012, with 2.7 compatibility being fairly good, it's worth seeing if pystache still needs this patch. |
I've made some quick changes for Python 2.2 support (tested with http://code.google.com/p/movable-python/downloads/detail?name=movpy-2.0.0-py2.2.3.zip ) I've not yet tried Jython 2.2.
Test suite is now runnable but there are some failures in the test. Py2.2 does NOT include datetime, decimal, or simplejson so these are additional requirements for 2.2 users.